from prefect import flow
from dli_block import DliBlock
import pytest
from pydantic import SecretStr
from obs_block1 import ObsBlock

#python -i dli-sdk-python-1.0.8/cs.py
#my_flow()

# region = "cn-north-4"
# endpoint = "dli.cn-north-4.myhuaweicloud.com"
# obs_endpoint = "obs.cn-north-4.myhuaweicloud.com"
# project_id = "3b5a2dafe5ec4c4894ea06c19e1c3485"
# username = "hid_y2majuno927nfmx"
# ak = "VYRH9QAPIEANQGL7PJYD"
# sk = "JiXGG5oAaOD60Ms5dHZmpdB0z26sQD31zGjNKX8R"
# queue_name = "default"

huaweicloud_dli_block = DliBlock.load("dliblock1")
client=huaweicloud_dli_block._get_dli_client()
# print(client)
print(huaweicloud_dli_block.huawei_cloud_access_key_id.get_secret_value())
# 在测试用例或测试配置中设置 Access Key ID
assert huaweicloud_dli_block.huawei_cloud_access_key_id.get_secret_value() == "VYRH9QAPIEANQGL7PJYD"


@pytest.fixture
def db_name():
    return "new1"
@flow
def test_create_db(db_name: str):
    created_db=huaweicloud_dli_block.create_db(db_name)
    assert created_db is not None

if __name__=="__main__":
    db_name='new1'
    test_create_db(db_name)